package com.aliang.chat.controller;

import com.aliang.chat.model.Result;
import com.aliang.chat.model.dto.ContactDTO;
import com.aliang.chat.service.ContactService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/contact")
public class ContactController {
    @Resource
    private ContactService contactService;

    @GetMapping("/getContactByUserId")
    public Result getContactByUserId(Integer id) {
        List<ContactDTO> contactList = contactService.getContactList(id);
        return Result.success(contactList);
    }
}
